import Vue from 'vue'
import Vuex from 'vuex'
import tagNav from '@/store/modules/tagNav'
import FormClass from '@/utils/form'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    SET_PAGE_HEIGHT: 0,
    selectProject: '',
  },
  getters:{
    SET_TABLE_HEIGHT:state=>{
      return state.SET_PAGE_HEIGHT - 180 < 300 ? 300 : state.SET_PAGE_HEIGHT - 180
    }
  },
  mutations: {
    'getCache'(state, playload) {
      FormClass.setForm(playload, state)
    },
    'SET_PAGE_HEIGHT'(state, height) {
      state.SET_PAGE_HEIGHT = height
    },
    updateSelectProject(state, newValue) {
      state.selectProject = newValue;
    },
  },
  actions: {},
  modules: {
    tagNav
  },
})
